<?php
	$id = $_GET['id'];
	//echo $id;
	
	
	$name=$_POST['bankuai'];
	//echo $name;
	$link=mysqli_connect('localhost','root','');
	//链接数据库
	//mysql_connect('localhost', 'root','');
	
	//选库
	mysqli_select_db($link,'test');
	
	mysql_set_charset('utf8');
	
	//写sql
	$sql = "update type set name='{$name}' where id='{$id}'";
	
	//执行
	mysqli_query($link,$sql);
	
	//判断 读取结果集
	if(mysqli_affected_rows($link) > 0){
		//header('location:./type_menu.php');
		header('location:./type_menu.php');	
		//redirect('location:./type_menu.php');
	}
	else{
		header('location:./type_updateFQ.php?id='.$id);
	}
	
?>